<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<div class='container'>
     <div class="tabbable"> <!-- Only required for left/right tabs -->
	<?=$tab_header;?>
       <div class="tab-content" style='height:450px;'>
         <div class="tab-pane active" id="table1">
		 <? //=$this->zetro_auth->allAuth($frm3,'active_member_list');?>
		 <?=$this->zetro_auth->allAuth($list,'active_member_list');?>
	   </div>
    </div>
<?=$modal;?>    
<?=$modal2;?>    
</div>
<input type='hidden' id='edited' name='edited' value=''/>
<? link_js('jquery.fixedheader','asset/js/');?>
<? //link_js('aktive_member','application/zetro_js/');?>

<script language='javascript'>
$(document).ready(function(e) {
	$('#frm100 #id_lokasi')
		.html("<?=$lok;?>").val('0001').select()
		.live('change',function(){_show_data('1');})
	$('#frm100 #c_cari').live('click',function(){_show_data('1');})
	_show_data('');
	$('#frm100 #prn').click(function(){ _print_prev();})
});

function _show_data(tp)
{
	show_indicator2('txt');//('NewList',8)
	$.post('get_list_aktiv_member',$('#frm100').serialize(),function(result)
	{
		$('#NewList tbody').html(result);
		$('span#txt').html(($('#NewList tr').length <=1)?'':'Total Data : '+format_number(($('#NewList tr').length-1),0));
		/*(tp=='')?
		fixHeader('NewList',250,370):'';*/
	})
}

function btn_click(id,aksi)
{
	switch(aksi)
	{
		case 'update':
		//document.location.href='<?=base_url();?>index.php/member/newdata?a=ac&id_reg='+id
			_get_detail(id,aksi);
		break;
		case 'show_detail':
			_get_detail(id,aksi);
		break;
		case 'deleted':
		jConfirm('Yakin Anggota ini akan di nonaktifkan','Ziebar Alert',function(r){
			if(r)
			{
				$.post('non_aktif_member',{'id_member':id},
				function(result)
				{
					_show_data('1');
				})
			}
		})
		break;
			
	}
}

function _get_detail(id,aksi)
{
	$.post('update_member',{'id_member':id,'aksi':aksi},function(result){
		$('div.modal-body')
			.html(result)
			.css({'max-height':(screen.availHeight-(screen.availHeight*35/100)),'overflow-x':'hidden'});
		$('#myModal').modal('show');
	})
}
function _print_prev()
{
	span_indicator('#txt');	
	$.post('printaktivmember',$('#frm100').serialize(),function(result)
	{
		$('#txt').html('');
		$('div#rst').css({'display':'none'});
		$('#prv').attr('src',result);
		$('#PrintPrev .modal-body').css({'width':(screen.availWidth-170),'height':(screen.availHeight-205),'overflow':'auto'});
		$('#PrintPrev')
			.css({'left':'25%','width':(screen.availWidth-150),'height':(screen.availHeight-150)})
			.modal('show');
	})
}
function _print_detail()
{
	span_indicator('#rst');	
	$.post('printdetailmember',{'id_reg':$('#id_reg').val()},function(result)
	{
		$('#rst').html('');
		$('#prv').attr('src',result);
		$('div#rst').css({'display':'none'});
		$('#PrintPrev .modal-body').css({'width':(screen.availWidth-170),'height':(screen.availHeight-205),'overflow':'auto'});
		$('#PrintPrev')
			.css({'left':'25%','width':(screen.availWidth-150),'height':(screen.availHeight-150)})
			.modal('show');
	})
}
</script>
